home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / devel / tcl / tclx7_31.z / tclx7_31 / tcldev / tclX7.3a-p1 / configure < prev    next >
Encoding:
Text File  |  1994-01-24  |  56.0 KB  |  2,246 lines

  1. #!/bin/sh
  2. # Guess values for system-dependent variables and create Makefiles.
  3. # Generated automatically using autoconf.
  4. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
  5.  
  6. # This program is free software; you can redistribute it and/or modify
  7. # it under the terms of the GNU General Public License as published by
  8. # the Free Software Foundation; either version 2, or (at your option)
  9. # any later version.
  10.  
  11. # This program is distributed in the hope that it will be useful,
  12. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. # GNU General Public License for more details.
  15.  
  16. # You should have received a copy of the GNU General Public License
  17. # along with this program; if not, write to the Free Software
  18. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19.  
  20. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp]
  21. #        [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE[=VALUE]]
  22. # Ignores all args except --srcdir, --prefix, --exec-prefix, and
  23. # --with-PACKAGE[=VALUE] unless this script has special code to handle it.
  24.  
  25. for arg
  26. do
  27.   # Handle --exec-prefix with a space before the argument.
  28.   if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
  29.   # Handle --host with a space before the argument.
  30.   elif test x$next_host = xyes; then next_host=
  31.   # Handle --prefix with a space before the argument.
  32.   elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
  33.   # Handle --srcdir with a space before the argument.
  34.   elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
  35.   else
  36.     case $arg in
  37.      # For backward compatibility, recognize -exec-prefix and --exec_prefix.
  38.      -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
  39.     exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  40.      -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
  41.     next_exec_prefix=yes ;;
  42.  
  43.      -gas | --gas | --ga | --g) ;;
  44.  
  45.      -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
  46.      -host | --host | --hos | --ho | --h)
  47.     next_host=yes ;;
  48.  
  49.      -nfp | --nfp | --nf) ;;
  50.  
  51.      -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
  52.     prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  53.      -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
  54.     next_prefix=yes ;;
  55.  
  56.      -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
  57.     srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
  58.      -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
  59.     next_srcdir=yes ;;
  60.  
  61.      -with-* | --with-*)
  62.        package=`echo $arg|sed -e 's/-*with-//' -e 's/=.*//'`
  63.        # Reject names that aren't valid shell variable names.
  64.        if test -n "`echo $package| sed 's/[-a-zA-Z0-9_]//g'`"; then
  65.          echo "configure: $package: invalid package name" >&2; exit 1
  66.        fi
  67.        package=`echo $package| sed 's/-/_/g'`
  68.        case "$arg" in
  69.          *=*) val="`echo $arg|sed 's/[^=]*=//'`" ;;
  70.          *) val=1 ;;
  71.        esac
  72.        eval "with_$package='$val'" ;;
  73.  
  74.      -v | -verbose | --verbose | --verbos | --verbo | --verb | --ver | --ve | --v)
  75.        verbose=yes ;;
  76.  
  77.      *) ;;
  78.     esac
  79.   fi
  80. done
  81.  
  82. trap 'rm -fr conftest* confdefs* core; exit 1' 1 3 15
  83. trap 'rm -f confdefs*' 0
  84.  
  85. # NLS nuisances.
  86. # These must not be set unconditionally because not all systems understand
  87. # e.g. LANG=C (notably SCO).
  88. if test "${LC_ALL+set}" = 'set' ; then LC_ALL=C; export LC_ALL; fi
  89. if test "${LANG+set}"   = 'set' ; then LANG=C;   export LANG;   fi
  90.  
  91. rm -f conftest* confdefs.h
  92. # AIX cpp loses on an empty file, so make sure it contains at least a newline.
  93. echo > confdefs.h
  94. compile='${CC-cc} $CFLAGS conftest.c -o conftest $LIBS >/dev/null 2>&1'
  95.  
  96. # A filename unique to this package, relative to the directory that
  97. # configure is in, which we can look for to find out if srcdir is correct.
  98. unique_file=src/tclExtend.h
  99.  
  100. # Find the source files, if location was not specified.
  101. if test -z "$srcdir"; then
  102.   srcdirdefaulted=yes
  103.   # Try the directory containing this script, then `..'.
  104.   prog=$0
  105.   confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
  106.   test "X$confdir" = "X$prog" && confdir=.
  107.   srcdir=$confdir
  108.   if test ! -r $srcdir/$unique_file; then
  109.     srcdir=..
  110.   fi
  111. fi
  112. if test ! -r $srcdir/$unique_file; then
  113.   if test x$srcdirdefaulted = xyes; then
  114.     echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
  115.   else
  116.     echo "configure: Can not find sources in \`${srcdir}'." 1>&2
  117.   fi
  118.   exit 1
  119. fi
  120. # Preserve a srcdir of `.' to avoid automounter screwups with pwd.
  121. # But we can't avoid them for `..', to make subdirectories work.
  122. case $srcdir in
  123.   .|/*|~*) ;;
  124.   *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
  125. esac
  126.  
  127.  
  128. # Save the original args to write them into config.status later.
  129. configure_args="$*"
  130.  
  131. #!/bin/sh
  132. # From configure.in Revision: 3.2 
  133.  
  134.  
  135.  
  136. #------------------------------------------------------------------------------
  137. #     Rescan command line looking for the --arch= option.
  138. #------------------------------------------------------------------------------
  139.  
  140. for arg in $configure_args
  141. do
  142.   # Handle --arch with a space before the argument.
  143.   if test x$next_arch = xyes; then TCL_ARCH=.$arg; next_arch=
  144.   else
  145.     case $arg in
  146.      --arch=*)
  147.     TCL_ARCH=.`echo $arg | sed 's/[-a-z_]*=//'` ;;
  148.      --arch)
  149.     next_arch=yes ;;
  150.     esac
  151.   fi
  152. done
  153.  
  154. if test x$TCL_ARCH = x
  155. then
  156.   echo "No architecture suffix will be used"
  157. else
  158.   echo "An architecture suffix of \"$TCL_ARCH\" will be appended to bin and lib directories."
  159. fi
  160.  
  161.  
  162. #------------------------------------------------------------------------------
  163. #     Check for various programs used during the build.
  164. #------------------------------------------------------------------------------
  165.  
  166. for p in 'bison -y' byacc
  167. do
  168. if test -z "$YACC"; then
  169.   # Extract the first word of `$p', so it can be a program name with args.
  170.   set dummy $p; word=$2
  171.   echo checking for $word
  172.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  173.   for dir in $PATH; do
  174.     test -z "$dir" && dir=.
  175.     if test -f $dir/$word; then
  176.       YACC="$p"
  177.       break
  178.     fi
  179.   done
  180.   IFS="$saveifs"
  181. fi
  182.  
  183. test -n "$YACC" && test -n "$verbose" && echo "    setting YACC to $YACC"
  184.  
  185. test -n "$YACC" && break
  186. done
  187. test -n "$YACC" || YACC="yacc"
  188.  
  189. if test -z "$RANLIB"; then
  190.   # Extract the first word of `ranlib', so it can be a program name with args.
  191.   set dummy ranlib; word=$2
  192.   echo checking for $word
  193.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  194.   for dir in $PATH; do
  195.     test -z "$dir" && dir=.
  196.     if test -f $dir/$word; then
  197.       RANLIB="ranlib"
  198.       break
  199.     fi
  200.   done
  201.   IFS="$saveifs"
  202. fi
  203. test -z "$RANLIB" && RANLIB=":"
  204. test -n "$RANLIB" && test -n "$verbose" && echo "    setting RANLIB to $RANLIB"
  205.  
  206. CC=${CC-cc}
  207.  
  208. if test -z "$MCS_CMD"; then
  209.   # Extract the first word of `"mcs"', so it can be a program name with args.
  210.   set dummy "mcs"; word=$2
  211.   echo checking for $word
  212.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  213.   for dir in $PATH; do
  214.     test -z "$dir" && dir=.
  215.     if test -f $dir/$word; then
  216.       MCS_CMD="mcs -d"
  217.       break
  218.     fi
  219.   done
  220.   IFS="$saveifs"
  221. fi
  222. test -z "$MCS_CMD" && MCS_CMD="touch"
  223. test -n "$MCS_CMD" && test -n "$verbose" && echo "    setting MCS_CMD to $MCS_CMD"
  224.  
  225.  
  226. #------------------------------------------------------------------------------
  227. #       Some make programs require includes to be 
  228. #         .include "file"
  229. #     others...
  230. #         include file
  231. #------------------------------------------------------------------------------
  232.  
  233. echo checking how make handles includes
  234. rm -fr conftestdir
  235. if mkdir conftestdir; then
  236.   cd conftestdir
  237.   cat > Makeinclude <<EOF
  238.  
  239. EOF
  240.   cat > Makefile <<EOF
  241. include Makeinclude
  242.  
  243. all:
  244. EOF
  245.   if make >/dev/null 2>/dev/null; then
  246.     MAKEINCLUDE="include"
  247.     MAKEQUOTE=''
  248.   else
  249.     MAKEINCLUDE=".include"
  250.     MAKEQUOTE='"'
  251.   fi
  252.   cd ..
  253.   rm -fr conftestdir
  254. fi
  255.  
  256.  
  257.  
  258. #------------------------------------------------------------------------------
  259. #       Check for system header files.
  260. #------------------------------------------------------------------------------
  261.  
  262. echo checking for values.h
  263. echo checking how to run the C preprocessor
  264. if test -z "$CPP"; then
  265.   # This must be in double quotes, not single quotes, because CPP may get
  266.   # substituted into the Makefile and ``${CC-cc}'' will simply confuse
  267.   # make.  It must be expanded now.
  268.   CPP="${CC-cc} -E"
  269.   cat > conftest.c <<EOF
  270. #include "confdefs.h"
  271. #include <stdio.h>
  272. Syntax Error
  273. EOF
  274. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  275. if test -z "$err"; then
  276.   :
  277. else
  278.   rm -rf conftest*
  279.   CPP=/lib/cpp
  280. fi
  281. rm -f conftest*
  282. fi
  283. test ".${verbose}" != "." && echo "    setting CPP to $CPP"
  284.  
  285. cat > conftest.c <<EOF
  286. #include "confdefs.h"
  287. #include <values.h>
  288. EOF
  289. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  290. if test -z "$err"; then
  291.   :
  292. else
  293.   rm -rf conftest*
  294.   
  295. {
  296. test -n "$verbose" && \
  297. echo "    defining NO_VALUES_H"
  298. echo "#define" NO_VALUES_H 1 >> confdefs.h
  299. DEFS="$DEFS -DNO_VALUES_H=1"
  300. SEDDEFS="${SEDDEFS}\${SEDdA}NO_VALUES_H\${SEDdB}NO_VALUES_H\${SEDdC}1\${SEDdD}
  301. \${SEDuA}NO_VALUES_H\${SEDuB}NO_VALUES_H\${SEDuC}1\${SEDuD}
  302. \${SEDeA}NO_VALUES_H\${SEDeB}NO_VALUES_H\${SEDeC}1\${SEDeD}
  303. "
  304. }
  305.  
  306. fi
  307. rm -f conftest*
  308.  
  309. echo checking for sys/socket.h
  310. cat > conftest.c <<EOF
  311. #include "confdefs.h"
  312. #include <sys/socket.h>
  313. EOF
  314. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  315. if test -z "$err"; then
  316.   :
  317. else
  318.   rm -rf conftest*
  319.   
  320. {
  321. test -n "$verbose" && \
  322. echo "    defining NO_SYS_SOCKET_H"
  323. echo "#define" NO_SYS_SOCKET_H 1 >> confdefs.h
  324. DEFS="$DEFS -DNO_SYS_SOCKET_H=1"
  325. SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_SOCKET_H\${SEDdB}NO_SYS_SOCKET_H\${SEDdC}1\${SEDdD}
  326. \${SEDuA}NO_SYS_SOCKET_H\${SEDuB}NO_SYS_SOCKET_H\${SEDuC}1\${SEDuD}
  327. \${SEDeA}NO_SYS_SOCKET_H\${SEDeB}NO_SYS_SOCKET_H\${SEDeC}1\${SEDeD}
  328. "
  329. }
  330.  
  331. fi
  332. rm -f conftest*
  333.  
  334.  
  335. #------------------------------------------------------------------------------
  336. #       Check for missing functions that we need.  They will be
  337. #       compiled in the osSupport directory. Must check for SCO
  338. #       -lintl, which is were strftime is hidden.
  339. #------------------------------------------------------------------------------
  340.  
  341. LIBS_save="${LIBS}"
  342. LIBS="${LIBS} -lintl"
  343. have_lib=""
  344. echo checking for -lintl
  345. cat > conftest.c <<EOF
  346. #include "confdefs.h"
  347.  
  348. int main() { exit(0); }
  349. int t() { main(); }
  350. EOF
  351. if eval $compile; then
  352.   rm -rf conftest*
  353.   have_lib="1"
  354.  
  355. fi
  356. rm -f conftest*
  357. LIBS="${LIBS_save}"
  358. if test -n "${have_lib}"; then
  359.    :; LIBS="$LIBS -lintl"
  360. else
  361.    :; 
  362. fi
  363.  
  364.  
  365. echo checking for strftime
  366. cat > conftest.c <<EOF
  367. #include "confdefs.h"
  368. #include <ctype.h>
  369. int main() { exit(0); }
  370. int t() { 
  371. /* The GNU C library defines this for functions which it implements
  372.     to always fail with ENOSYS.  Some functions are actually named
  373.     something starting with __ and the normal name is an alias.  */
  374. #if defined (__stub_strftime) || defined (__stub___strftime)
  375. choke me
  376. #else
  377. /* Override any gcc2 internal prototype to avoid an error.  */
  378. extern char strftime(); strftime();
  379. #endif
  380.  }
  381. EOF
  382. if eval $compile; then
  383.   :
  384. else
  385.   rm -rf conftest*
  386.   LIBOBJS="$LIBOBJS strftime.o"
  387. fi
  388. rm -f conftest*
  389.  
  390. echo checking for random
  391. cat > conftest.c <<EOF
  392. #include "confdefs.h"
  393. #include <ctype.h>
  394. int main() { exit(0); }
  395. int t() { 
  396. /* The GNU C library defines this for functions which it implements
  397.     to always fail with ENOSYS.  Some functions are actually named
  398.     something starting with __ and the normal name is an alias.  */
  399. #if defined (__stub_random) || defined (__stub___random)
  400. choke me
  401. #else
  402. /* Override any gcc2 internal prototype to avoid an error.  */
  403. extern char random(); random();
  404. #endif
  405.  }
  406. EOF
  407. if eval $compile; then
  408.   :
  409. else
  410.   rm -rf conftest*
  411.   LIBOBJS="$LIBOBJS random.o"
  412. fi
  413. rm -f conftest*
  414.  
  415. echo checking for rename
  416. cat > conftest.c <<EOF
  417. #include "confdefs.h"
  418. #include <ctype.h>
  419. int main() { exit(0); }
  420. int t() { 
  421. /* The GNU C library defines this for functions which it implements
  422.     to always fail with ENOSYS.  Some functions are actually named
  423.     something starting with __ and the normal name is an alias.  */
  424. #if defined (__stub_rename) || defined (__stub___rename)
  425. choke me
  426. #else
  427. /* Override any gcc2 internal prototype to avoid an error.  */
  428. extern char rename(); rename();
  429. #endif
  430.  }
  431. EOF
  432. if eval $compile; then
  433.   :
  434. else
  435.   rm -rf conftest*
  436.   LIBOBJS="$LIBOBJS rename.o"
  437. fi
  438. rm -f conftest*
  439.  
  440.  
  441.  
  442. #------------------------------------------------------------------------------
  443. #       Check for missing typedefs.
  444. #------------------------------------------------------------------------------
  445.  
  446. echo checking for time_t
  447. cat > conftest.c <<EOF
  448. #include "confdefs.h"
  449. #include <sys/types.h>
  450. int main() { exit(0); }
  451. int t() {  }
  452. EOF
  453. if eval $compile; then
  454.   :
  455. else
  456.   rm -rf conftest*
  457.   
  458. {
  459. test -n "$verbose" && \
  460. echo "    defining" time_t to be long
  461. echo "#define" time_t long >> confdefs.h
  462. DEFS="$DEFS -Dtime_t=long"
  463. SEDDEFS="${SEDDEFS}\${SEDdA}time_t\${SEDdB}time_t\${SEDdC}long\${SEDdD}
  464. \${SEDuA}time_t\${SEDuB}time_t\${SEDuC}long\${SEDuD}
  465. \${SEDeA}time_t\${SEDeB}time_t\${SEDeC}long\${SEDeD}
  466. "
  467. }
  468.  
  469. fi
  470. rm -f conftest*
  471.  
  472.  
  473. #------------------------------------------------------------------------------
  474. #       What type do signals return?
  475. #------------------------------------------------------------------------------
  476.  
  477. echo checking for return type of signal handlers
  478. cat > conftest.c <<EOF
  479. #include "confdefs.h"
  480. #include <sys/types.h>
  481. #include <signal.h>
  482. #ifdef signal
  483. #undef signal
  484. #endif
  485. extern void (*signal ()) ();
  486. int main() { exit(0); }
  487. int t() { int i; }
  488. EOF
  489. if eval $compile; then
  490.   rm -rf conftest*
  491.   
  492. {
  493. test -n "$verbose" && \
  494. echo "    defining" RETSIGTYPE to be void
  495. echo "#define" RETSIGTYPE void >> confdefs.h
  496. DEFS="$DEFS -DRETSIGTYPE=void"
  497. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}void\${SEDdD}
  498. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}void\${SEDuD}
  499. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}void\${SEDeD}
  500. "
  501. }
  502.  
  503.  
  504. else
  505.   rm -rf conftest*
  506.   
  507. {
  508. test -n "$verbose" && \
  509. echo "    defining" RETSIGTYPE to be int
  510. echo "#define" RETSIGTYPE int >> confdefs.h
  511. DEFS="$DEFS -DRETSIGTYPE=int"
  512. SEDDEFS="${SEDDEFS}\${SEDdA}RETSIGTYPE\${SEDdB}RETSIGTYPE\${SEDdC}int\${SEDdD}
  513. \${SEDuA}RETSIGTYPE\${SEDuB}RETSIGTYPE\${SEDuC}int\${SEDuD}
  514. \${SEDeA}RETSIGTYPE\${SEDeB}RETSIGTYPE\${SEDeC}int\${SEDeD}
  515. "
  516. }
  517.  
  518. fi
  519. rm -f conftest*
  520.  
  521.  
  522.  
  523. #------------------------------------------------------------------------------
  524. #       Find out all about time handling differences.
  525. #------------------------------------------------------------------------------
  526.  
  527. echo checking for whether time.h and sys/time.h may both be included
  528. cat > conftest.c <<EOF
  529. #include "confdefs.h"
  530. #include <sys/types.h>
  531. #include <sys/time.h>
  532. #include <time.h>
  533. int main() { exit(0); }
  534. int t() { struct tm *tp; }
  535. EOF
  536. if eval $compile; then
  537.   rm -rf conftest*
  538.   
  539. {
  540. test -n "$verbose" && \
  541. echo "    defining TIME_WITH_SYS_TIME"
  542. echo "#define" TIME_WITH_SYS_TIME 1 >> confdefs.h
  543. DEFS="$DEFS -DTIME_WITH_SYS_TIME=1"
  544. SEDDEFS="${SEDDEFS}\${SEDdA}TIME_WITH_SYS_TIME\${SEDdB}TIME_WITH_SYS_TIME\${SEDdC}1\${SEDdD}
  545. \${SEDuA}TIME_WITH_SYS_TIME\${SEDuB}TIME_WITH_SYS_TIME\${SEDuC}1\${SEDuD}
  546. \${SEDeA}TIME_WITH_SYS_TIME\${SEDeB}TIME_WITH_SYS_TIME\${SEDeC}1\${SEDeD}
  547. "
  548. }
  549.  
  550.  
  551. fi
  552. rm -f conftest*
  553.  
  554. echo checking for struct tm in time.h
  555. cat > conftest.c <<EOF
  556. #include "confdefs.h"
  557. #include <sys/types.h>
  558. #include <time.h>
  559. int main() { exit(0); }
  560. int t() { struct tm *tp; tp->tm_sec; }
  561. EOF
  562. if eval $compile; then
  563.   :
  564. else
  565.   rm -rf conftest*
  566.   
  567. {
  568. test -n "$verbose" && \
  569. echo "    defining TM_IN_SYS_TIME"
  570. echo "#define" TM_IN_SYS_TIME 1 >> confdefs.h
  571. DEFS="$DEFS -DTM_IN_SYS_TIME=1"
  572. SEDDEFS="${SEDDEFS}\${SEDdA}TM_IN_SYS_TIME\${SEDdB}TM_IN_SYS_TIME\${SEDdC}1\${SEDdD}
  573. \${SEDuA}TM_IN_SYS_TIME\${SEDuB}TM_IN_SYS_TIME\${SEDuC}1\${SEDuD}
  574. \${SEDeA}TM_IN_SYS_TIME\${SEDeB}TM_IN_SYS_TIME\${SEDeC}1\${SEDeD}
  575. "
  576. }
  577.  
  578. fi
  579. rm -f conftest*
  580.  
  581. decl='#include <sys/types.h>
  582. '
  583. case "$DEFS" in
  584.   *TM_IN_SYS_TIME*) decl="$decl
  585. #include <sys/time.h>
  586. " ;;
  587.   *) decl="$decl
  588. #include <time.h>
  589. " ;;
  590. esac
  591. echo checking for tm_zone in struct tm
  592. cat > conftest.c <<EOF
  593. #include "confdefs.h"
  594. $decl
  595. int main() { exit(0); }
  596. int t() { struct tm tm; tm.tm_zone; }
  597. EOF
  598. if eval $compile; then
  599.   rm -rf conftest*
  600.   
  601. {
  602. test -n "$verbose" && \
  603. echo "    defining HAVE_TM_ZONE"
  604. echo "#define" HAVE_TM_ZONE 1 >> confdefs.h
  605. DEFS="$DEFS -DHAVE_TM_ZONE=1"
  606. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_ZONE\${SEDdB}HAVE_TM_ZONE\${SEDdC}1\${SEDdD}
  607. \${SEDuA}HAVE_TM_ZONE\${SEDuB}HAVE_TM_ZONE\${SEDuC}1\${SEDuD}
  608. \${SEDeA}HAVE_TM_ZONE\${SEDeB}HAVE_TM_ZONE\${SEDeC}1\${SEDeD}
  609. "
  610. }
  611.  
  612.  
  613. else
  614.   rm -rf conftest*
  615.   no_tm_zone=1
  616. fi
  617. rm -f conftest*
  618.  
  619. if test -n "$no_tm_zone"; then
  620. echo checking for tzname
  621. cat > conftest.c <<EOF
  622. #include "confdefs.h"
  623. #include <time.h>
  624. #ifndef tzname /* For SGI.  */
  625. extern char *tzname[]; /* RS6000 and others want it this way.  */
  626. #endif
  627. int main() { exit(0); }
  628. int t() { atoi(*tzname); }
  629. EOF
  630. if eval $compile; then
  631.   rm -rf conftest*
  632.   
  633. {
  634. test -n "$verbose" && \
  635. echo "    defining HAVE_TZNAME"
  636. echo "#define" HAVE_TZNAME 1 >> confdefs.h
  637. DEFS="$DEFS -DHAVE_TZNAME=1"
  638. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TZNAME\${SEDdB}HAVE_TZNAME\${SEDdC}1\${SEDdD}
  639. \${SEDuA}HAVE_TZNAME\${SEDuB}HAVE_TZNAME\${SEDuC}1\${SEDuD}
  640. \${SEDeA}HAVE_TZNAME\${SEDeB}HAVE_TZNAME\${SEDeC}1\${SEDeD}
  641. "
  642. }
  643.  
  644.  
  645. fi
  646. rm -f conftest*
  647.  
  648. fi
  649.  
  650.  
  651. echo checking for tm_tzadj in struct tm
  652. cat > conftest.c <<EOF
  653. #include "confdefs.h"
  654. $decl
  655. int main() { exit(0); }
  656. int t() { struct tm tm; tm.tm_tzadj; }
  657. EOF
  658. if eval $compile; then
  659.   rm -rf conftest*
  660.   
  661. {
  662. test -n "$verbose" && \
  663. echo "    defining HAVE_TM_TZADJ"
  664. echo "#define" HAVE_TM_TZADJ 1 >> confdefs.h
  665. DEFS="$DEFS -DHAVE_TM_TZADJ=1"
  666. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_TZADJ\${SEDdB}HAVE_TM_TZADJ\${SEDdC}1\${SEDdD}
  667. \${SEDuA}HAVE_TM_TZADJ\${SEDuB}HAVE_TM_TZADJ\${SEDuC}1\${SEDuD}
  668. \${SEDeA}HAVE_TM_TZADJ\${SEDeB}HAVE_TM_TZADJ\${SEDeC}1\${SEDeD}
  669. "
  670. }
  671.  
  672.  
  673. fi
  674. rm -f conftest*
  675.  
  676.  
  677. echo checking for tm_gmtoff in struct tm
  678. cat > conftest.c <<EOF
  679. #include "confdefs.h"
  680. $decl
  681. int main() { exit(0); }
  682. int t() { struct tm tm; tm.tm_gmtoff; }
  683. EOF
  684. if eval $compile; then
  685.   rm -rf conftest*
  686.   
  687. {
  688. test -n "$verbose" && \
  689. echo "    defining HAVE_TM_GMTOFF"
  690. echo "#define" HAVE_TM_GMTOFF 1 >> confdefs.h
  691. DEFS="$DEFS -DHAVE_TM_GMTOFF=1"
  692. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TM_GMTOFF\${SEDdB}HAVE_TM_GMTOFF\${SEDdC}1\${SEDdD}
  693. \${SEDuA}HAVE_TM_GMTOFF\${SEDuB}HAVE_TM_GMTOFF\${SEDuC}1\${SEDuD}
  694. \${SEDeA}HAVE_TM_GMTOFF\${SEDeB}HAVE_TM_GMTOFF\${SEDeC}1\${SEDeD}
  695. "
  696. }
  697.  
  698.  
  699. fi
  700. rm -f conftest*
  701.  
  702.  
  703. for func in gettimeofday
  704. do
  705. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  706. echo checking for ${func}
  707. cat > conftest.c <<EOF
  708. #include "confdefs.h"
  709. #include <ctype.h>
  710. int main() { exit(0); }
  711. int t() { 
  712. /* The GNU C library defines this for functions which it implements
  713.     to always fail with ENOSYS.  Some functions are actually named
  714.     something starting with __ and the normal name is an alias.  */
  715. #if defined (__stub_${func}) || defined (__stub___${func})
  716. choke me
  717. #else
  718. /* Override any gcc2 internal prototype to avoid an error.  */
  719. extern char ${func}(); ${func}();
  720. #endif
  721.  }
  722. EOF
  723. if eval $compile; then
  724.   rm -rf conftest*
  725.   {
  726. test -n "$verbose" && \
  727. echo "    defining ${trfunc}"
  728. echo "#define" ${trfunc} 1 >> confdefs.h
  729. DEFS="$DEFS -D${trfunc}=1"
  730. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  731. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  732. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  733. "
  734. }
  735.  
  736.  
  737. fi
  738. rm -f conftest*
  739. done
  740.  
  741.  
  742. echo checking for timezone variable
  743. cat > conftest.c <<EOF
  744. #include "confdefs.h"
  745.  
  746. int main() { exit(0); }
  747. int t() { 
  748. extern long timezone;
  749. timezone += 1;
  750. exit (0);
  751.  }
  752. EOF
  753. if eval $compile; then
  754.   rm -rf conftest*
  755.   
  756. {
  757. test -n "$verbose" && \
  758. echo "    defining HAVE_TIMEZONE_VAR"
  759. echo "#define" HAVE_TIMEZONE_VAR 1 >> confdefs.h
  760. DEFS="$DEFS -DHAVE_TIMEZONE_VAR=1"
  761. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_TIMEZONE_VAR\${SEDdB}HAVE_TIMEZONE_VAR\${SEDdC}1\${SEDdD}
  762. \${SEDuA}HAVE_TIMEZONE_VAR\${SEDuB}HAVE_TIMEZONE_VAR\${SEDuC}1\${SEDuD}
  763. \${SEDeA}HAVE_TIMEZONE_VAR\${SEDeB}HAVE_TIMEZONE_VAR\${SEDeC}1\${SEDeD}
  764. "
  765. }
  766.  
  767.  
  768. fi
  769. rm -f conftest*
  770.  
  771.  
  772. #------------------------------------------------------------------------------
  773. #     Test to see if "times" returns a status or the amount of
  774. #     elapsed real time.
  775. #------------------------------------------------------------------------------
  776.  
  777. echo "checking to see if 'times' returns the elapsed real time"
  778. cat > conftest.c <<EOF
  779. #include "confdefs.h"
  780.  
  781. #include <sys/types.h>
  782. #include <sys/times.h>
  783. main() {
  784. struct tms cpu;
  785. times (&cpu);
  786. sleep (2);
  787. if (times (&cpu) > 0)
  788.      exit (0);
  789. else 
  790.      exit (1);
  791. }
  792.  
  793. EOF
  794. eval $compile
  795. if test -s conftest && (./conftest; exit) 2>/dev/null; then
  796.   
  797. {
  798. test -n "$verbose" && \
  799. echo "    defining TIMES_RETS_REAL_TIME"
  800. echo "#define" TIMES_RETS_REAL_TIME 1 >> confdefs.h
  801. DEFS="$DEFS -DTIMES_RETS_REAL_TIME=1"
  802. SEDDEFS="${SEDDEFS}\${SEDdA}TIMES_RETS_REAL_TIME\${SEDdB}TIMES_RETS_REAL_TIME\${SEDdC}1\${SEDdD}
  803. \${SEDuA}TIMES_RETS_REAL_TIME\${SEDuB}TIMES_RETS_REAL_TIME\${SEDuC}1\${SEDuD}
  804. \${SEDeA}TIMES_RETS_REAL_TIME\${SEDeB}TIMES_RETS_REAL_TIME\${SEDeC}1\${SEDeD}
  805. "
  806. }
  807.  
  808.  
  809. fi
  810. rm -fr conftest*
  811.  
  812. #------------------------------------------------------------------------------
  813. #     Determine if "." is used as separator for the manual directory
  814. #     names.  i.e. man/man.1 vs man/man1
  815. #------------------------------------------------------------------------------
  816.  
  817. echo "checking man directory/section separator (man/man.1 vs man/man1)"
  818. mandirs="/usr/man/man.1 /usr/man/cat.1 /usr/share/man.1 /usr/share/man.1 
  819.         /usr/man/cat.C"
  820. gotdotdir="NO"
  821. for d in $mandirs
  822. do
  823.     if test -d $d
  824.     then
  825.         gotdotdir="YES"
  826.     fi
  827. done
  828.  
  829. mandirs="/usr/man/man1   /usr/man/cat1   /usr/share/man1   /usr/share/man1
  830.          /usr/man/man1.Z /usr/man/cat1.Z /usr/share/man1.Z /usr/share/man1.Z"
  831. gotnodotdir="NO"
  832. for d in $mandirs
  833. do
  834.     if test -d $d
  835.     then
  836.         gotnodotdir="YES"
  837.     fi
  838. done
  839.  
  840. if test $gotdotdir = YES -a $gotnodotdir = NO
  841. then
  842.     MAN_DIR_SEPARATOR="."
  843. elif test $gotdotdir = NO -a $gotnodotdir = YES
  844. then
  845.     MAN_DIR_SEPARATOR=""
  846. else
  847.     MAN_DIR_SEPARATOR="."
  848.     echo "WARNING: could not determine man directory/section separator"
  849.     echo "         assuming man/man.1 (can override in Config.mk)."
  850. fi
  851.  
  852.  
  853. #------------------------------------------------------------------------------
  854. # Define srcbasedir and bldbasedir as absolute paths.
  855. #------------------------------------------------------------------------------
  856.  
  857. srcbasedir=`cd $srcdir;pwd`
  858.  
  859. bldbasedir=`pwd`
  860.  
  861.  
  862. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  863. #                      Begin code from Tcl configure.in
  864. #------------------------------------------------------------------------------
  865.  
  866. #--------------------------------------------------------------------
  867. #       Supply substitutes for missing POSIX library procedures, or
  868. #       set flags so Tcl uses alternate procedures.
  869. #--------------------------------------------------------------------
  870.  
  871. echo checking for gettimeofday
  872. cat > conftest.c <<EOF
  873. #include "confdefs.h"
  874. #include <ctype.h>
  875. int main() { exit(0); }
  876. int t() { 
  877. /* The GNU C library defines this for functions which it implements
  878.     to always fail with ENOSYS.  Some functions are actually named
  879.     something starting with __ and the normal name is an alias.  */
  880. #if defined (__stub_gettimeofday) || defined (__stub___gettimeofday)
  881. choke me
  882. #else
  883. /* Override any gcc2 internal prototype to avoid an error.  */
  884. extern char gettimeofday(); gettimeofday();
  885. #endif
  886.  }
  887. EOF
  888. if eval $compile; then
  889.   :
  890. else
  891.   rm -rf conftest*
  892.   {
  893. test -n "$verbose" && \
  894. echo "    defining NO_GETTOD"
  895. echo "#define" NO_GETTOD 1 >> confdefs.h
  896. DEFS="$DEFS -DNO_GETTOD=1"
  897. SEDDEFS="${SEDDEFS}\${SEDdA}NO_GETTOD\${SEDdB}NO_GETTOD\${SEDdC}1\${SEDdD}
  898. \${SEDuA}NO_GETTOD\${SEDuB}NO_GETTOD\${SEDuC}1\${SEDuD}
  899. \${SEDeA}NO_GETTOD\${SEDeB}NO_GETTOD\${SEDeC}1\${SEDeD}
  900. "
  901. }
  902.  
  903. fi
  904. rm -f conftest*
  905.  
  906.  
  907. #--------------------------------------------------------------------
  908. #       Supply substitutes for missing POSIX header files.  Special
  909. #       notes:
  910. #           - Sprite's dirent.h exists but is bogus.
  911. #           - stdlib.h doesn't define strtol, strtoul, or
  912. #             strtod insome versions of SunOS
  913. #           - some versions of string.h don't declare procedures such
  914. #             as strstr
  915. #--------------------------------------------------------------------
  916.  
  917. echo checking for unistd.h
  918. cat > conftest.c <<EOF
  919. #include "confdefs.h"
  920. #include <unistd.h>
  921. EOF
  922. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  923. if test -z "$err"; then
  924.   rm -rf conftest*
  925.   
  926. {
  927. test -n "$verbose" && \
  928. echo "    defining HAVE_UNISTD_H"
  929. echo "#define" HAVE_UNISTD_H 1 >> confdefs.h
  930. DEFS="$DEFS -DHAVE_UNISTD_H=1"
  931. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_UNISTD_H\${SEDdB}HAVE_UNISTD_H\${SEDdC}1\${SEDdD}
  932. \${SEDuA}HAVE_UNISTD_H\${SEDuB}HAVE_UNISTD_H\${SEDuC}1\${SEDuD}
  933. \${SEDeA}HAVE_UNISTD_H\${SEDeB}HAVE_UNISTD_H\${SEDeC}1\${SEDeD}
  934. "
  935. }
  936.  
  937.  
  938. fi
  939. rm -f conftest*
  940.  
  941. echo checking for dirent.h
  942. cat > conftest.c <<EOF
  943. #include "confdefs.h"
  944. #include <sys/types.h>
  945. #include <dirent.h>
  946. int main() { exit(0); }
  947. int t() { 
  948. DIR *d;
  949. struct dirent *entryPtr;
  950. char *p;
  951. d = opendir("foobar");
  952. entryPtr = readdir(d);
  953. p = entryPtr->d_name;
  954. closedir(d);
  955.  }
  956. EOF
  957. if eval $compile; then
  958.   rm -rf conftest*
  959.   tcl_ok=1
  960.  
  961. else
  962.   rm -rf conftest*
  963.   tcl_ok=0
  964. fi
  965. rm -f conftest*
  966.  
  967. echo '#include "confdefs.h"
  968. #include <tcl_ok=0>' > conftest.c
  969. eval "$CPP conftest.c > conftest.out 2>&1"
  970. if egrep "Sprite version.* NOT POSIX" conftest.out >/dev/null 2>&1; then
  971.   :
  972. fi
  973. rm -f conftest*
  974.  
  975. if test $tcl_ok = 0; then
  976.     
  977. {
  978. test -n "$verbose" && \
  979. echo "    defining NO_DIRENT_H"
  980. echo "#define" NO_DIRENT_H 1 >> confdefs.h
  981. DEFS="$DEFS -DNO_DIRENT_H=1"
  982. SEDDEFS="${SEDDEFS}\${SEDdA}NO_DIRENT_H\${SEDdB}NO_DIRENT_H\${SEDdC}1\${SEDdD}
  983. \${SEDuA}NO_DIRENT_H\${SEDuB}NO_DIRENT_H\${SEDuC}1\${SEDuD}
  984. \${SEDeA}NO_DIRENT_H\${SEDeB}NO_DIRENT_H\${SEDeC}1\${SEDeD}
  985. "
  986. }
  987.  
  988. fi
  989. echo checking for errno.h
  990. cat > conftest.c <<EOF
  991. #include "confdefs.h"
  992. #include <errno.h>
  993. EOF
  994. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  995. if test -z "$err"; then
  996.   :
  997. else
  998.   rm -rf conftest*
  999.   
  1000. {
  1001. test -n "$verbose" && \
  1002. echo "    defining NO_ERRNO_H"
  1003. echo "#define" NO_ERRNO_H 1 >> confdefs.h
  1004. DEFS="$DEFS -DNO_ERRNO_H=1"
  1005. SEDDEFS="${SEDDEFS}\${SEDdA}NO_ERRNO_H\${SEDdB}NO_ERRNO_H\${SEDdC}1\${SEDdD}
  1006. \${SEDuA}NO_ERRNO_H\${SEDuB}NO_ERRNO_H\${SEDuC}1\${SEDuD}
  1007. \${SEDeA}NO_ERRNO_H\${SEDeB}NO_ERRNO_H\${SEDeC}1\${SEDeD}
  1008. "
  1009. }
  1010.  
  1011. fi
  1012. rm -f conftest*
  1013.  
  1014. echo checking for float.h
  1015. cat > conftest.c <<EOF
  1016. #include "confdefs.h"
  1017. #include <float.h>
  1018. EOF
  1019. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1020. if test -z "$err"; then
  1021.   :
  1022. else
  1023.   rm -rf conftest*
  1024.   
  1025. {
  1026. test -n "$verbose" && \
  1027. echo "    defining NO_FLOAT_H"
  1028. echo "#define" NO_FLOAT_H 1 >> confdefs.h
  1029. DEFS="$DEFS -DNO_FLOAT_H=1"
  1030. SEDDEFS="${SEDDEFS}\${SEDdA}NO_FLOAT_H\${SEDdB}NO_FLOAT_H\${SEDdC}1\${SEDdD}
  1031. \${SEDuA}NO_FLOAT_H\${SEDuB}NO_FLOAT_H\${SEDuC}1\${SEDuD}
  1032. \${SEDeA}NO_FLOAT_H\${SEDeB}NO_FLOAT_H\${SEDeC}1\${SEDeD}
  1033. "
  1034. }
  1035.  
  1036. fi
  1037. rm -f conftest*
  1038.  
  1039. echo checking for limits.h
  1040. cat > conftest.c <<EOF
  1041. #include "confdefs.h"
  1042. #include <limits.h>
  1043. EOF
  1044. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1045. if test -z "$err"; then
  1046.   :
  1047. else
  1048.   rm -rf conftest*
  1049.   
  1050. {
  1051. test -n "$verbose" && \
  1052. echo "    defining NO_LIMITS_H"
  1053. echo "#define" NO_LIMITS_H 1 >> confdefs.h
  1054. DEFS="$DEFS -DNO_LIMITS_H=1"
  1055. SEDDEFS="${SEDDEFS}\${SEDdA}NO_LIMITS_H\${SEDdB}NO_LIMITS_H\${SEDdC}1\${SEDdD}
  1056. \${SEDuA}NO_LIMITS_H\${SEDuB}NO_LIMITS_H\${SEDuC}1\${SEDuD}
  1057. \${SEDeA}NO_LIMITS_H\${SEDeB}NO_LIMITS_H\${SEDeC}1\${SEDeD}
  1058. "
  1059. }
  1060.  
  1061. fi
  1062. rm -f conftest*
  1063.  
  1064. echo checking for stdlib.h
  1065. cat > conftest.c <<EOF
  1066. #include "confdefs.h"
  1067. #include <stdlib.h>
  1068. EOF
  1069. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1070. if test -z "$err"; then
  1071.   rm -rf conftest*
  1072.   tcl_ok=1
  1073.  
  1074. else
  1075.   rm -rf conftest*
  1076.   tcl_ok=0
  1077. fi
  1078. rm -f conftest*
  1079.  
  1080. echo '#include "confdefs.h"
  1081. #include <stdlib.h>' > conftest.c
  1082. eval "$CPP conftest.c > conftest.out 2>&1"
  1083. if egrep "strtol" conftest.out >/dev/null 2>&1; then
  1084.   :
  1085. else
  1086.   rm -rf conftest*
  1087.   tcl_ok=0
  1088. fi
  1089. rm -f conftest*
  1090.  
  1091. echo '#include "confdefs.h"
  1092. #include <stdlib.h>' > conftest.c
  1093. eval "$CPP conftest.c > conftest.out 2>&1"
  1094. if egrep "strtoul" conftest.out >/dev/null 2>&1; then
  1095.   :
  1096. else
  1097.   rm -rf conftest*
  1098.   tcl_ok=0
  1099. fi
  1100. rm -f conftest*
  1101.  
  1102. echo '#include "confdefs.h"
  1103. #include <stdlib.h>' > conftest.c
  1104. eval "$CPP conftest.c > conftest.out 2>&1"
  1105. if egrep "strtod" conftest.out >/dev/null 2>&1; then
  1106.   :
  1107. else
  1108.   rm -rf conftest*
  1109.   tcl_ok=0
  1110. fi
  1111. rm -f conftest*
  1112.  
  1113. if test $tcl_ok = 0; then
  1114.     
  1115. {
  1116. test -n "$verbose" && \
  1117. echo "    defining NO_STDLIB_H"
  1118. echo "#define" NO_STDLIB_H 1 >> confdefs.h
  1119. DEFS="$DEFS -DNO_STDLIB_H=1"
  1120. SEDDEFS="${SEDDEFS}\${SEDdA}NO_STDLIB_H\${SEDdB}NO_STDLIB_H\${SEDdC}1\${SEDdD}
  1121. \${SEDuA}NO_STDLIB_H\${SEDuB}NO_STDLIB_H\${SEDuC}1\${SEDuD}
  1122. \${SEDeA}NO_STDLIB_H\${SEDeB}NO_STDLIB_H\${SEDeC}1\${SEDeD}
  1123. "
  1124. }
  1125.  
  1126. fi
  1127. echo checking for string.h
  1128. cat > conftest.c <<EOF
  1129. #include "confdefs.h"
  1130. #include <string.h>
  1131. EOF
  1132. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1133. if test -z "$err"; then
  1134.   rm -rf conftest*
  1135.   tcl_ok=1
  1136.  
  1137. else
  1138.   rm -rf conftest*
  1139.   tcl_ok=0
  1140. fi
  1141. rm -f conftest*
  1142.  
  1143. echo '#include "confdefs.h"
  1144. #include <string.h>' > conftest.c
  1145. eval "$CPP conftest.c > conftest.out 2>&1"
  1146. if egrep "strstr" conftest.out >/dev/null 2>&1; then
  1147.   :
  1148. else
  1149.   rm -rf conftest*
  1150.   tcl_ok=0
  1151. fi
  1152. rm -f conftest*
  1153.  
  1154. echo '#include "confdefs.h"
  1155. #include <string.h>' > conftest.c
  1156. eval "$CPP conftest.c > conftest.out 2>&1"
  1157. if egrep "strerror" conftest.out >/dev/null 2>&1; then
  1158.   :
  1159. else
  1160.   rm -rf conftest*
  1161.   tcl_ok=0
  1162. fi
  1163. rm -f conftest*
  1164.  
  1165. if test $tcl_ok = 0; then
  1166.     
  1167. {
  1168. test -n "$verbose" && \
  1169. echo "    defining NO_STRING_H"
  1170. echo "#define" NO_STRING_H 1 >> confdefs.h
  1171. DEFS="$DEFS -DNO_STRING_H=1"
  1172. SEDDEFS="${SEDDEFS}\${SEDdA}NO_STRING_H\${SEDdB}NO_STRING_H\${SEDdC}1\${SEDdD}
  1173. \${SEDuA}NO_STRING_H\${SEDuB}NO_STRING_H\${SEDuC}1\${SEDuD}
  1174. \${SEDeA}NO_STRING_H\${SEDeB}NO_STRING_H\${SEDeC}1\${SEDeD}
  1175. "
  1176. }
  1177.  
  1178. fi
  1179. echo checking for sys/time.h
  1180. cat > conftest.c <<EOF
  1181. #include "confdefs.h"
  1182. #include <sys/time.h>
  1183. EOF
  1184. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1185. if test -z "$err"; then
  1186.   :
  1187. else
  1188.   rm -rf conftest*
  1189.   
  1190. {
  1191. test -n "$verbose" && \
  1192. echo "    defining NO_SYS_TIME_H"
  1193. echo "#define" NO_SYS_TIME_H 1 >> confdefs.h
  1194. DEFS="$DEFS -DNO_SYS_TIME_H=1"
  1195. SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_TIME_H\${SEDdB}NO_SYS_TIME_H\${SEDdC}1\${SEDdD}
  1196. \${SEDuA}NO_SYS_TIME_H\${SEDuB}NO_SYS_TIME_H\${SEDuC}1\${SEDuD}
  1197. \${SEDeA}NO_SYS_TIME_H\${SEDeB}NO_SYS_TIME_H\${SEDeC}1\${SEDeD}
  1198. "
  1199. }
  1200.  
  1201. fi
  1202. rm -f conftest*
  1203.  
  1204. echo checking for sys/wait.h
  1205. cat > conftest.c <<EOF
  1206. #include "confdefs.h"
  1207. #include <sys/wait.h>
  1208. EOF
  1209. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1210. if test -z "$err"; then
  1211.   :
  1212. else
  1213.   rm -rf conftest*
  1214.   
  1215. {
  1216. test -n "$verbose" && \
  1217. echo "    defining NO_SYS_WAIT_H"
  1218. echo "#define" NO_SYS_WAIT_H 1 >> confdefs.h
  1219. DEFS="$DEFS -DNO_SYS_WAIT_H=1"
  1220. SEDDEFS="${SEDDEFS}\${SEDdA}NO_SYS_WAIT_H\${SEDdB}NO_SYS_WAIT_H\${SEDdC}1\${SEDdD}
  1221. \${SEDuA}NO_SYS_WAIT_H\${SEDuB}NO_SYS_WAIT_H\${SEDuC}1\${SEDuD}
  1222. \${SEDeA}NO_SYS_WAIT_H\${SEDeB}NO_SYS_WAIT_H\${SEDeC}1\${SEDeD}
  1223. "
  1224. }
  1225.  
  1226. fi
  1227. rm -f conftest*
  1228.  
  1229.  
  1230. #--------------------------------------------------------------------
  1231. #       Check for various typedefs and provide substitutes if
  1232. #       they don't exist.
  1233. #--------------------------------------------------------------------
  1234.  
  1235. echo checking for mode_t in sys/types.h
  1236. echo '#include "confdefs.h"
  1237. #include <sys/types.h>' > conftest.c
  1238. eval "$CPP conftest.c > conftest.out 2>&1"
  1239. if egrep "mode_t" conftest.out >/dev/null 2>&1; then
  1240.   :
  1241. else
  1242.   rm -rf conftest*
  1243.   
  1244. {
  1245. test -n "$verbose" && \
  1246. echo "    defining" mode_t to be int
  1247. echo "#define" mode_t int >> confdefs.h
  1248. DEFS="$DEFS -Dmode_t=int"
  1249. SEDDEFS="${SEDDEFS}\${SEDdA}mode_t\${SEDdB}mode_t\${SEDdC}int\${SEDdD}
  1250. \${SEDuA}mode_t\${SEDuB}mode_t\${SEDuC}int\${SEDuD}
  1251. \${SEDeA}mode_t\${SEDeB}mode_t\${SEDeC}int\${SEDeD}
  1252. "
  1253. }
  1254.  
  1255. fi
  1256. rm -f conftest*
  1257.  
  1258. echo checking for pid_t in sys/types.h
  1259. echo '#include "confdefs.h"
  1260. #include <sys/types.h>' > conftest.c
  1261. eval "$CPP conftest.c > conftest.out 2>&1"
  1262. if egrep "pid_t" conftest.out >/dev/null 2>&1; then
  1263.   :
  1264. else
  1265.   rm -rf conftest*
  1266.   
  1267. {
  1268. test -n "$verbose" && \
  1269. echo "    defining" pid_t to be int
  1270. echo "#define" pid_t int >> confdefs.h
  1271. DEFS="$DEFS -Dpid_t=int"
  1272. SEDDEFS="${SEDDEFS}\${SEDdA}pid_t\${SEDdB}pid_t\${SEDdC}int\${SEDdD}
  1273. \${SEDuA}pid_t\${SEDuB}pid_t\${SEDuC}int\${SEDuD}
  1274. \${SEDeA}pid_t\${SEDeB}pid_t\${SEDeC}int\${SEDeD}
  1275. "
  1276. }
  1277.  
  1278. fi
  1279. rm -f conftest*
  1280.  
  1281. echo checking for size_t in sys/types.h
  1282. echo '#include "confdefs.h"
  1283. #include <sys/types.h>' > conftest.c
  1284. eval "$CPP conftest.c > conftest.out 2>&1"
  1285. if egrep "size_t" conftest.out >/dev/null 2>&1; then
  1286.   :
  1287. else
  1288.   rm -rf conftest*
  1289.   
  1290. {
  1291. test -n "$verbose" && \
  1292. echo "    defining" size_t to be unsigned
  1293. echo "#define" size_t unsigned >> confdefs.h
  1294. DEFS="$DEFS -Dsize_t=unsigned"
  1295. SEDDEFS="${SEDDEFS}\${SEDdA}size_t\${SEDdB}size_t\${SEDdC}unsigned\${SEDdD}
  1296. \${SEDuA}size_t\${SEDuB}size_t\${SEDuC}unsigned\${SEDuD}
  1297. \${SEDeA}size_t\${SEDeB}size_t\${SEDeC}unsigned\${SEDeD}
  1298. "
  1299. }
  1300.  
  1301. fi
  1302. rm -f conftest*
  1303.  
  1304. echo checking for uid_t in sys/types.h
  1305. echo '#include "confdefs.h"
  1306. #include <sys/types.h>' > conftest.c
  1307. eval "$CPP conftest.c > conftest.out 2>&1"
  1308. if egrep "uid_t" conftest.out >/dev/null 2>&1; then
  1309.   :
  1310. else
  1311.   rm -rf conftest*
  1312.   
  1313. {
  1314. test -n "$verbose" && \
  1315. echo "    defining" uid_t to be int
  1316. echo "#define" uid_t int >> confdefs.h
  1317. DEFS="$DEFS -Duid_t=int"
  1318. SEDDEFS="${SEDDEFS}\${SEDdA}uid_t\${SEDdB}uid_t\${SEDdC}int\${SEDdD}
  1319. \${SEDuA}uid_t\${SEDuB}uid_t\${SEDuC}int\${SEDuD}
  1320. \${SEDeA}uid_t\${SEDeB}uid_t\${SEDeC}int\${SEDeD}
  1321. "
  1322. }
  1323.  
  1324. {
  1325. test -n "$verbose" && \
  1326. echo "    defining" gid_t to be int
  1327. echo "#define" gid_t int >> confdefs.h
  1328. DEFS="$DEFS -Dgid_t=int"
  1329. SEDDEFS="${SEDDEFS}\${SEDdA}gid_t\${SEDdB}gid_t\${SEDdC}int\${SEDdD}
  1330. \${SEDuA}gid_t\${SEDuB}gid_t\${SEDuC}int\${SEDuD}
  1331. \${SEDeA}gid_t\${SEDeB}gid_t\${SEDeC}int\${SEDeD}
  1332. "
  1333. }
  1334.  
  1335. fi
  1336. rm -f conftest*
  1337.  
  1338.  
  1339. #--------------------------------------------------------------------
  1340. #       If a system doesn't have an opendir function (man, that's old!)
  1341. #       then we have to supply a different version of dirent.h which
  1342. #       is compatible with the substitute version of opendir that's
  1343. #       provided.  This version only works with V7-style directories.
  1344. #--------------------------------------------------------------------
  1345.  
  1346. echo checking for opendir
  1347. cat > conftest.c <<EOF
  1348. #include "confdefs.h"
  1349. #include <ctype.h>
  1350. int main() { exit(0); }
  1351. int t() { 
  1352. /* The GNU C library defines this for functions which it implements
  1353.     to always fail with ENOSYS.  Some functions are actually named
  1354.     something starting with __ and the normal name is an alias.  */
  1355. #if defined (__stub_opendir) || defined (__stub___opendir)
  1356. choke me
  1357. #else
  1358. /* Override any gcc2 internal prototype to avoid an error.  */
  1359. extern char opendir(); opendir();
  1360. #endif
  1361.  }
  1362. EOF
  1363. if eval $compile; then
  1364.   :
  1365. else
  1366.   rm -rf conftest*
  1367.   {
  1368. test -n "$verbose" && \
  1369. echo "    defining USE_DIRENT2_H"
  1370. echo "#define" USE_DIRENT2_H 1 >> confdefs.h
  1371. DEFS="$DEFS -DUSE_DIRENT2_H=1"
  1372. SEDDEFS="${SEDDEFS}\${SEDdA}USE_DIRENT2_H\${SEDdB}USE_DIRENT2_H\${SEDdC}1\${SEDdD}
  1373. \${SEDuA}USE_DIRENT2_H\${SEDuB}USE_DIRENT2_H\${SEDuC}1\${SEDuD}
  1374. \${SEDeA}USE_DIRENT2_H\${SEDeB}USE_DIRENT2_H\${SEDeC}1\${SEDeD}
  1375. "
  1376. }
  1377.  
  1378. fi
  1379. rm -f conftest*
  1380.  
  1381.  
  1382. #--------------------------------------------------------------------
  1383. #       The check below checks whether <sys/wait.h> defines the type
  1384. #       "union wait" correctly.  It's needed because of weirdness in
  1385. #       HP-UX where "union wait" is defined in both the BSD and SYS-V
  1386. #       environments.  Checking the usability of WIFEXITED seems to do
  1387. #       the trick.
  1388. #--------------------------------------------------------------------
  1389.  
  1390. echo checking for union wait
  1391. cat > conftest.c <<EOF
  1392. #include "confdefs.h"
  1393. #include <sys/types.h> 
  1394. #include <sys/wait.h>
  1395. int main() { exit(0); }
  1396. int t() { 
  1397. union wait x;
  1398. WIFEXITED(x);           /* Generates compiler error if WIFEXITED
  1399.                          * uses an int. */
  1400.  }
  1401. EOF
  1402. if eval $compile; then
  1403.   :
  1404. else
  1405.   rm -rf conftest*
  1406.   
  1407. {
  1408. test -n "$verbose" && \
  1409. echo "    defining NO_UNION_WAIT"
  1410. echo "#define" NO_UNION_WAIT 1 >> confdefs.h
  1411. DEFS="$DEFS -DNO_UNION_WAIT=1"
  1412. SEDDEFS="${SEDDEFS}\${SEDdA}NO_UNION_WAIT\${SEDdB}NO_UNION_WAIT\${SEDdC}1\${SEDdD}
  1413. \${SEDuA}NO_UNION_WAIT\${SEDuB}NO_UNION_WAIT\${SEDuC}1\${SEDuD}
  1414. \${SEDeA}NO_UNION_WAIT\${SEDeB}NO_UNION_WAIT\${SEDeC}1\${SEDeD}
  1415. "
  1416. }
  1417.  
  1418. fi
  1419. rm -f conftest*
  1420.  
  1421.  
  1422. #------------------------------------------------------------------------------
  1423. #                       End code from Tcl configure.in
  1424. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1425.  
  1426.  
  1427. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1428. #                      Begin code from Tk configure.in
  1429. # Notes: Added check for X11_s.
  1430. #------------------------------------------------------------------------------
  1431.  
  1432. #--------------------------------------------------------------------
  1433. #    Include sys/select.h if it exists and if it supplies things
  1434. #    that appear to be useful and aren't already in sys/types.h.
  1435. #    This appears to be true only on the RS/6000 under AIX.  Some
  1436. #    systems like OSF/1 have a sys/select.h that's of no use, and
  1437. #    other systems like SCO UNIX have a sys/select.h that's
  1438. #    pernicious.  If "fd_set" isn't defined anywhere then set a
  1439. #    special flag.
  1440. #--------------------------------------------------------------------
  1441.  
  1442. echo checking for sys/select.h
  1443. echo checking for fd_set
  1444. cat > conftest.c <<EOF
  1445. #include "confdefs.h"
  1446. #include <sys/types.h>
  1447. int main() { exit(0); }
  1448. int t() { fd_set readMask, writeMask; }
  1449. EOF
  1450. if eval $compile; then
  1451.   :
  1452. else
  1453.   rm -rf conftest*
  1454.   echo '#include "confdefs.h"
  1455. #include <sys/select.h>' > conftest.c
  1456. eval "$CPP conftest.c > conftest.out 2>&1"
  1457. if egrep "fd_mask" conftest.out >/dev/null 2>&1; then
  1458.   rm -rf conftest*
  1459.   
  1460. {
  1461. test -n "$verbose" && \
  1462. echo "    defining HAVE_SYS_SELECT_H"
  1463. echo "#define" HAVE_SYS_SELECT_H 1 >> confdefs.h
  1464. DEFS="$DEFS -DHAVE_SYS_SELECT_H=1"
  1465. SEDDEFS="${SEDDEFS}\${SEDdA}HAVE_SYS_SELECT_H\${SEDdB}HAVE_SYS_SELECT_H\${SEDdC}1\${SEDdD}
  1466. \${SEDuA}HAVE_SYS_SELECT_H\${SEDuB}HAVE_SYS_SELECT_H\${SEDuC}1\${SEDuD}
  1467. \${SEDeA}HAVE_SYS_SELECT_H\${SEDeB}HAVE_SYS_SELECT_H\${SEDeC}1\${SEDeD}
  1468. "
  1469. }
  1470.  
  1471.  
  1472. else
  1473.   rm -rf conftest*
  1474.   
  1475. {
  1476. test -n "$verbose" && \
  1477. echo "    defining NO_FD_SET"
  1478. echo "#define" NO_FD_SET 1 >> confdefs.h
  1479. DEFS="$DEFS -DNO_FD_SET=1"
  1480. SEDDEFS="${SEDDEFS}\${SEDdA}NO_FD_SET\${SEDdB}NO_FD_SET\${SEDdC}1\${SEDdD}
  1481. \${SEDuA}NO_FD_SET\${SEDuB}NO_FD_SET\${SEDuC}1\${SEDuD}
  1482. \${SEDeA}NO_FD_SET\${SEDeB}NO_FD_SET\${SEDeC}1\${SEDeD}
  1483. "
  1484. }
  1485.  
  1486. fi
  1487. rm -f conftest*
  1488.  
  1489. fi
  1490. rm -f conftest*
  1491.  
  1492.  
  1493. #--------------------------------------------------------------------
  1494. #    Locate the X11 header files and the X11 library archive.  Try
  1495. #    the ac_find_x macro first, but if it doesn't find the X stuff
  1496. #    (e.g. because there's no xmkmf program) then check through
  1497. #    a list of possible directories.
  1498. #--------------------------------------------------------------------
  1499.  
  1500. if test -z "$tk_ok"; then
  1501.   # Extract the first word of `xmkmf', so it can be a program name with args.
  1502.   set dummy xmkmf; word=$2
  1503.   echo checking for $word
  1504.   IFS="${IFS=     }"; saveifs="$IFS"; IFS="${IFS}:"
  1505.   for dir in $PATH; do
  1506.     test -z "$dir" && dir=.
  1507.     if test -f $dir/$word; then
  1508.       tk_ok="1"
  1509.       break
  1510.     fi
  1511.   done
  1512.   IFS="$saveifs"
  1513. fi
  1514. test -z "$tk_ok" && tk_ok="0"
  1515. test -n "$tk_ok" && test -n "$verbose" && echo "    setting tk_ok to $tk_ok"
  1516.  
  1517. if test $tk_ok = 1; then
  1518.     # If we find X, set shell vars x_includes and x_libraries to the paths.
  1519. no_x=true
  1520. echo checking for X include and library files with xmkmf
  1521. rm -fr conftestdir
  1522. if mkdir conftestdir; then
  1523.   cd conftestdir
  1524.   cat > Imakefile <<\EOF
  1525. acfindx:
  1526.     @echo "im_incroot=$(INCROOT); im_usrlibdir=$(USRLIBDIR); im_libdir=$(LIBDIR)"
  1527. EOF
  1528.   if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
  1529.     no_x=
  1530.     # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
  1531.     eval `make acfindx | grep -v make`
  1532.     # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
  1533.     if test ! -f $im_usrlibdir/libX11.a && test -f $im_libdir/libX11.a; then
  1534.       im_usrlibdir=$im_libdir
  1535.     fi
  1536.     case "$im_incroot" in
  1537.     /usr/include) ;;
  1538.     *) x_includes="$im_incroot" ;;
  1539.     esac
  1540.     case "$im_usrlibdir" in
  1541.     /usr/lib | /lib) ;;
  1542.     *) x_libraries="$im_usrlibdir" ;;
  1543.     esac
  1544.   fi
  1545.   cd ..
  1546.   rm -fr conftestdir
  1547. fi
  1548.  
  1549. if test -z "$im_usrlibdir"; then
  1550. echo checking for X include and library files directly
  1551. cat > conftest.c <<EOF
  1552. #include "confdefs.h"
  1553. #include <X11/Intrinsic.h>
  1554. EOF
  1555. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1556. if test -z "$err"; then
  1557.   rm -rf conftest*
  1558.   no_x=
  1559.  
  1560. else
  1561.   rm -rf conftest*
  1562.   for dir in \
  1563.     /usr/local/include \
  1564.     /usr/unsupported/include \
  1565.     /usr/x386/include \
  1566.     /usr/local/x11r5/include \
  1567.     /usr/include/X11R5 \
  1568.     /usr/include/X11R4 \
  1569.     /usr/X11R5/include \
  1570.     /usr/X11/include \
  1571.     /usr/openwin/include \
  1572.     /usr/openwin/share/include \
  1573.     /usr/lpp/Xamples/include \
  1574.     ; \
  1575.   do
  1576.     if test -r $dir/X11/Intrinsic.h; then
  1577.       x_includes=$dir; no_x=
  1578.       break
  1579.     fi
  1580.   done
  1581. fi
  1582. rm -f conftest*
  1583.  
  1584. # Check for the libraries.  First see if replacing the `include' by
  1585. # `lib' works.
  1586. LIBS_save="${LIBS}"
  1587. LIBS="${LIBS} -lXt"
  1588. have_lib=""
  1589. echo checking for -lXt
  1590. cat > conftest.c <<EOF
  1591. #include "confdefs.h"
  1592.  
  1593. int main() { exit(0); }
  1594. int t() { main(); }
  1595. EOF
  1596. if eval $compile; then
  1597.   rm -rf conftest*
  1598.   have_lib="1"
  1599.  
  1600. fi
  1601. rm -f conftest*
  1602. LIBS="${LIBS_save}"
  1603. if test -n "${have_lib}"; then
  1604.    :; no_x=
  1605. else
  1606.    :; for dir in `echo "$x_includes" | sed s/include/lib/` \
  1607.   /usr/local/lib \
  1608.   /usr/unsupported/lib \
  1609.   /usr/x386/lib \
  1610.   /usr/local/x11r5/lib \
  1611.   /usr/lib/X11 \
  1612.   /usr/lib/X11R4 \
  1613.   /usr/X11R5/lib \
  1614.   /usr/X11/lib \
  1615.   /usr/openwin/lib \
  1616.   /usr/lpp/Xamples/lib \
  1617.   ; \
  1618. do
  1619.   for extension in a so sl; do
  1620.     if test -r $dir/libXt.$extension; then
  1621.       x_libraries=$dir; no_x=
  1622.       break 2
  1623.     fi
  1624.   done
  1625. done
  1626. fi
  1627.  
  1628. fi
  1629. if test -n "$verbose"; then
  1630.   test -n "$x_includes" && echo "    found X11 headers in $x_includes"
  1631.   test -n "$x_libraries" && echo "    found X11 libraries in $x_libraries"
  1632. fi
  1633. fi
  1634. if test "$XINCLUDE_DIR" != ""; then
  1635.      x_includes="$XINCLUDE_DIR"
  1636. fi
  1637. if test "$x_includes" = /usr/include; then
  1638.     XINCLUDES="# no special path needed"
  1639. elif test "$x_includes" != ""; then
  1640.     XINCLUDES=" -I$x_includes"
  1641. else
  1642.     echo checking for X11 header files
  1643.     XINCLUDES="# no special path needed"
  1644.     cat > conftest.c <<EOF
  1645. #include "confdefs.h"
  1646. #include <X11/Intrinsic.h>
  1647. EOF
  1648. err=`eval "($CPP conftest.c >/dev/null) 2>&1"`
  1649. if test -z "$err"; then
  1650.   :
  1651. else
  1652.   rm -rf conftest*
  1653.   XINCLUDES="nope"
  1654. fi
  1655. rm -f conftest*
  1656.     if test "$XINCLUDES" = nope; then
  1657.         dirs="/usr/unsupported/include /usr/local/include /usr/X386/include /usr/include/X11R4 /usr/X11R5/include /usr/include/X11R5 /usr/openwin/include /usr/X11/include"
  1658.         for i in $dirs ; do
  1659.         if test -r $i/X11/Intrinsic.h; then
  1660.             XINCLUDES=" -I$i"
  1661.         fi
  1662.         done
  1663.     fi
  1664. fi
  1665. if test "$XINCLUDES" = nope; then
  1666.   echo "Warning:  couldn't find any X11 include files."
  1667.   XINCLUDES="# no include files found"
  1668. fi
  1669.  
  1670.  
  1671. if test "$XLIBRARY_DIR" != ""; then
  1672.     x_libraries="$XLIBRARY_DIR"
  1673. fi
  1674. if test "$x_libraries" = /usr/lib; then
  1675.     XLIBSW=-lX11
  1676. elif test "$x_libraries" != ""; then
  1677.     XLIBSW="-L$x_libraries -lX11"
  1678. else
  1679.     echo "checking for X11 library archive"
  1680.     LIBS_save="${LIBS}"
  1681. LIBS="${LIBS} -lX11_s"
  1682. have_lib=""
  1683. echo checking for -lX11_s
  1684. cat > conftest.c <<EOF
  1685. #include "confdefs.h"
  1686.  
  1687. int main() { exit(0); }
  1688. int t() { main(); }
  1689. EOF
  1690. if eval $compile; then
  1691.   rm -rf conftest*
  1692.   have_lib="1"
  1693.  
  1694. fi
  1695. rm -f conftest*
  1696. LIBS="${LIBS_save}"
  1697. if test -n "${have_lib}"; then
  1698.    :; XLIBSW="-lX11_s"
  1699. else
  1700.    :; XLIBSW=nope
  1701. fi
  1702.  
  1703.     if test "$XLIBSW" = nope; then
  1704.         LIBS_save="${LIBS}"
  1705. LIBS="${LIBS} -lX11"
  1706. have_lib=""
  1707. echo checking for -lX11
  1708. cat > conftest.c <<EOF
  1709. #include "confdefs.h"
  1710.  
  1711. int main() { exit(0); }
  1712. int t() { main(); }
  1713. EOF
  1714. if eval $compile; then
  1715.   rm -rf conftest*
  1716.   have_lib="1"
  1717.  
  1718. fi
  1719. rm -f conftest*
  1720. LIBS="${LIBS_save}"
  1721. if test -n "${have_lib}"; then
  1722.    :; XLIBSW="-lX11"
  1723. else
  1724.    :; XLIBSW=nope
  1725. fi
  1726.  
  1727.     fi
  1728.     if test "$XLIBSW" = nope; then
  1729.     dirs=${XLIBRARY_DIR-"/usr/unsupported/lib /usr/local/lib /usr/X386/lib /usr/lib/X11R4 /usr/X11R5/lib /usr/lib/X11R5 /usr/openwin/lib /usr/X11/lib"}
  1730.         for i in $dirs ; do
  1731.         if test -r $i/libX11.a; then
  1732.         XLIBSW="-L$i -lX11"
  1733.         fi
  1734.     done
  1735.     fi
  1736. fi
  1737. if test "$XLIBSW" = nope ; then
  1738.     LIBS_save="${LIBS}"
  1739. LIBS="${LIBS} -lXwindow"
  1740. have_lib=""
  1741. echo checking for -lXwindow
  1742. cat > conftest.c <<EOF
  1743. #include "confdefs.h"
  1744.  
  1745. int main() { exit(0); }
  1746. int t() { main(); }
  1747. EOF
  1748. if eval $compile; then
  1749.   rm -rf conftest*
  1750.   have_lib="1"
  1751.  
  1752. fi
  1753. rm -f conftest*
  1754. LIBS="${LIBS_save}"
  1755. if test -n "${have_lib}"; then
  1756.    :; XLIBSW=-lXwindow
  1757. else
  1758.    :; 
  1759. fi
  1760.  
  1761. fi
  1762. if test "$XLIBSW" = nope ; then
  1763.     echo "Warning:  couldn't find the X11 library archive.  Using -lX11."
  1764.     XLIBSW=-lX11
  1765. fi
  1766.  
  1767.  
  1768. #------------------------------------------------------------------------------
  1769. #       Check for the existence of various libraries.  The order here
  1770. #       is important, so that then end up in the right order in the
  1771. #       command line generated by Make.
  1772. #------------------------------------------------------------------------------
  1773.  
  1774. LIBS_save="${LIBS}"
  1775. LIBS="${LIBS} -lXbsd"
  1776. have_lib=""
  1777. echo checking for -lXbsd
  1778. cat > conftest.c <<EOF
  1779. #include "confdefs.h"
  1780.  
  1781. int main() { exit(0); }
  1782. int t() { main(); }
  1783. EOF
  1784. if eval $compile; then
  1785.   rm -rf conftest*
  1786.   have_lib="1"
  1787.  
  1788. fi
  1789. rm -f conftest*
  1790. LIBS="${LIBS_save}"
  1791. if test -n "${have_lib}"; then
  1792.    :; LIBS="$LIBS -lXbsd"
  1793. else
  1794.    :; 
  1795. fi
  1796.  
  1797. LIBS_save="${LIBS}"
  1798. LIBS="${LIBS} -lsocket"
  1799. have_lib=""
  1800. echo checking for -lsocket
  1801. cat > conftest.c <<EOF
  1802. #include "confdefs.h"
  1803.  
  1804. int main() { exit(0); }
  1805. int t() { main(); }
  1806. EOF
  1807. if eval $compile; then
  1808.   rm -rf conftest*
  1809.   have_lib="1"
  1810.  
  1811. fi
  1812. rm -f conftest*
  1813. LIBS="${LIBS_save}"
  1814. if test -n "${have_lib}"; then
  1815.    :; LIBS="$LIBS -lsocket"
  1816. else
  1817.    :; 
  1818. fi
  1819.  
  1820. LIBS_save="${LIBS}"
  1821. LIBS="${LIBS} -lnsl"
  1822. have_lib=""
  1823. echo checking for -lnsl
  1824. cat > conftest.c <<EOF
  1825. #include "confdefs.h"
  1826.  
  1827. int main() { exit(0); }
  1828. int t() { main(); }
  1829. EOF
  1830. if eval $compile; then
  1831.   rm -rf conftest*
  1832.   have_lib="1"
  1833.  
  1834. fi
  1835. rm -f conftest*
  1836. LIBS="${LIBS_save}"
  1837. if test -n "${have_lib}"; then
  1838.    :; LIBS="$LIBS -lnsl"
  1839. else
  1840.    :; 
  1841. fi
  1842.  
  1843.  
  1844. #------------------------------------------------------------------------------
  1845. #                       End code from Tk configure.in
  1846. #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  1847.  
  1848. #------------------------------------------------------------------------------
  1849. #       Check for additional libraries the Tcl/Tk does not check for.
  1850. #------------------------------------------------------------------------------
  1851.  
  1852. LIBS_save="${LIBS}"
  1853. LIBS="${LIBS} -lsun"
  1854. have_lib=""
  1855. echo checking for -lsun
  1856. cat > conftest.c <<EOF
  1857. #include "confdefs.h"
  1858.  
  1859. int main() { exit(0); }
  1860. int t() { main(); }
  1861. EOF
  1862. if eval $compile; then
  1863.   rm -rf conftest*
  1864.   have_lib="1"
  1865.  
  1866. fi
  1867. rm -f conftest*
  1868. LIBS="${LIBS_save}"
  1869. if test -n "${have_lib}"; then
  1870.    :; LIBS="$LIBS -lsun"
  1871. else
  1872.    :; 
  1873. fi
  1874.  
  1875. LIBS_save="${LIBS}"
  1876. LIBS="${LIBS} -lc_s"
  1877. have_lib=""
  1878. echo checking for -lc_s
  1879. cat > conftest.c <<EOF
  1880. #include "confdefs.h"
  1881.  
  1882. int main() { exit(0); }
  1883. int t() { main(); }
  1884. EOF
  1885. if eval $compile; then
  1886.   rm -rf conftest*
  1887.   have_lib="1"
  1888.  
  1889. fi
  1890. rm -f conftest*
  1891. LIBS="${LIBS_save}"
  1892. if test -n "${have_lib}"; then
  1893.    :; LIBS="$LIBS -lc_s"
  1894. else
  1895.    :; 
  1896. fi
  1897.  
  1898. LIBS_save="${LIBS}"
  1899. LIBS="${LIBS} -lieee"
  1900. have_lib=""
  1901. echo checking for -lieee
  1902. cat > conftest.c <<EOF
  1903. #include "confdefs.h"
  1904.  
  1905. int main() { exit(0); }
  1906. int t() { main(); }
  1907. EOF
  1908. if eval $compile; then
  1909.   rm -rf conftest*
  1910.   have_lib="1"
  1911.  
  1912. fi
  1913. rm -f conftest*
  1914. LIBS="${LIBS_save}"
  1915. if test -n "${have_lib}"; then
  1916.    :; LIBS="$LIBS -lieee"
  1917. else
  1918.    :; 
  1919. fi
  1920.  
  1921.  
  1922. #------------------------------------------------------------------------------
  1923. #       Check for various Unix or library functions that can be used by TclX.
  1924. #       These must be after the library checks.
  1925. #------------------------------------------------------------------------------
  1926.  
  1927. for func in catgets getcwd select setitimer setlinebuf sigaction setpgid
  1928. do
  1929. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1930. echo checking for ${func}
  1931. cat > conftest.c <<EOF
  1932. #include "confdefs.h"
  1933. #include <ctype.h>
  1934. int main() { exit(0); }
  1935. int t() { 
  1936. /* The GNU C library defines this for functions which it implements
  1937.     to always fail with ENOSYS.  Some functions are actually named
  1938.     something starting with __ and the normal name is an alias.  */
  1939. #if defined (__stub_${func}) || defined (__stub___${func})
  1940. choke me
  1941. #else
  1942. /* Override any gcc2 internal prototype to avoid an error.  */
  1943. extern char ${func}(); ${func}();
  1944. #endif
  1945.  }
  1946. EOF
  1947. if eval $compile; then
  1948.   rm -rf conftest*
  1949.   {
  1950. test -n "$verbose" && \
  1951. echo "    defining ${trfunc}"
  1952. echo "#define" ${trfunc} 1 >> confdefs.h
  1953. DEFS="$DEFS -D${trfunc}=1"
  1954. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1955. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1956. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1957. "
  1958. }
  1959.  
  1960.  
  1961. fi
  1962. rm -f conftest*
  1963. done
  1964.  
  1965. for func in bzero bcopy gethostbyname fsync getpriority
  1966. do
  1967. trfunc=HAVE_`echo $func | tr '[a-z]' '[A-Z]'`
  1968. echo checking for ${func}
  1969. cat > conftest.c <<EOF
  1970. #include "confdefs.h"
  1971. #include <ctype.h>
  1972. int main() { exit(0); }
  1973. int t() { 
  1974. /* The GNU C library defines this for functions which it implements
  1975.     to always fail with ENOSYS.  Some functions are actually named
  1976.     something starting with __ and the normal name is an alias.  */
  1977. #if defined (__stub_${func}) || defined (__stub___${func})
  1978. choke me
  1979. #else
  1980. /* Override any gcc2 internal prototype to avoid an error.  */
  1981. extern char ${func}(); ${func}();
  1982. #endif
  1983.  }
  1984. EOF
  1985. if eval $compile; then
  1986.   rm -rf conftest*
  1987.   {
  1988. test -n "$verbose" && \
  1989. echo "    defining ${trfunc}"
  1990. echo "#define" ${trfunc} 1 >> confdefs.h
  1991. DEFS="$DEFS -D${trfunc}=1"
  1992. SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD}
  1993. \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD}
  1994. \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD}
  1995. "
  1996. }
  1997.  
  1998.  
  1999. fi
  2000. rm -f conftest*
  2001. done
  2002.  
  2003.  
  2004. #------------------------------------------------------------------------------
  2005. #       If Config.mk is not in the build directory, copy it local.
  2006. #------------------------------------------------------------------------------
  2007.  
  2008. if test ! -r Config.mk
  2009. then
  2010.     echo "Copying $srcdir/Config.mk to build directory"
  2011.     cp $srcdir/Config.mk  Config.mk || exit 1
  2012. fi
  2013.  
  2014. #------------------------------------------------------------------------------
  2015. #       Copy the tests to the build directory if they are not there.
  2016. #       We could do something fancier, but this is easy for now.
  2017. #------------------------------------------------------------------------------
  2018.  
  2019. if test ! -d tests
  2020. then
  2021.     echo "Copying $srcdir/tests contents to build directory"
  2022.     mkdir tests
  2023.     # Prevent line to long on some systems.
  2024.     CURDIR=`pwd`
  2025.     cd $srcdir/tests
  2026.     cp *.test *.tcl all $CURDIR/tests || exit 1
  2027.     cd $CURDIR
  2028. fi
  2029.  
  2030. #------------------------------------------------------------------------------
  2031. # Generate the make files.
  2032. #------------------------------------------------------------------------------
  2033.  
  2034.  
  2035.  
  2036.  
  2037. # Set default prefixes.
  2038. if test -n "$prefix"; then
  2039.   test -z "$exec_prefix" && exec_prefix='${prefix}'
  2040.   prsub="s%^prefix\\([     ]*\\)=\\([     ]*\\).*$%prefix\\1=\\2$prefix%"
  2041. fi
  2042. if test -n "$exec_prefix"; then
  2043.   prsub="$prsub
  2044. s%^exec_prefix\\([     ]*\\)=\\([     ]*\\).*$%exec_prefix\\1=\\2$exec_prefix%"
  2045. fi
  2046. # Quote sed substitution magic chars in DEFS.
  2047. cat >conftest.def <<EOF
  2048. $DEFS
  2049. EOF
  2050. escape_ampersand_and_backslash='s%[&\\]%\\&%g'
  2051. DEFS=`sed "$escape_ampersand_and_backslash" <conftest.def`
  2052. rm -f conftest.def
  2053. # Substitute for predefined variables.
  2054.  
  2055. trap 'rm -f config.status; exit 1' 1 3 15
  2056. echo creating config.status
  2057. rm -f config.status
  2058. cat > config.status <<EOF
  2059. #!/bin/sh
  2060. # Generated automatically by configure.
  2061. # Run this file to recreate the current configuration.
  2062. # This directory was configured as follows,
  2063. # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
  2064. #
  2065. # $0 $configure_args
  2066.  
  2067. for arg
  2068. do
  2069.   case "\$arg" in
  2070.     -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  2071.     echo running \${CONFIG_SHELL-/bin/sh} $0 $configure_args
  2072.     exec \${CONFIG_SHELL-/bin/sh} $0 $configure_args ;;
  2073.     *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
  2074.   esac
  2075. done
  2076.  
  2077. trap 'rm -fr Makefile osSupport/Makefile src/Makefile tclsrc/Makefile tksrc/Makefile tktclsrc/Makefile tools/Makefile src/SYSLIBS tksrc/SYSLIBS src/tclXconfig.h conftest*; exit 1' 1 3 15
  2078. TCL_ARCH='$TCL_ARCH'
  2079. YACC='$YACC'
  2080. RANLIB='$RANLIB'
  2081. CC='$CC'
  2082. MCS_CMD='$MCS_CMD'
  2083. MAKEINCLUDE='$MAKEINCLUDE'
  2084. MAKEQUOTE='$MAKEQUOTE'
  2085. CPP='$CPP'
  2086. LIBOBJS='$LIBOBJS'
  2087. MAN_DIR_SEPARATOR='$MAN_DIR_SEPARATOR'
  2088. srcbasedir='$srcbasedir'
  2089. bldbasedir='$bldbasedir'
  2090. tk_ok='$tk_ok'
  2091. XINCLUDES='$XINCLUDES'
  2092. XLIBSW='$XLIBSW'
  2093. prefix='$prefix'
  2094. execprefix='$execprefix'
  2095. LIBS='$LIBS'
  2096. srcdir='$srcdir'
  2097. prefix='$prefix'
  2098. exec_prefix='$exec_prefix'
  2099. prsub='$prsub'
  2100. extrasub='$extrasub'
  2101. EOF
  2102. cat >> config.status <<\EOF
  2103.  
  2104. top_srcdir=$srcdir
  2105.  
  2106. CONFIG_FILES=${CONFIG_FILES-"Makefile osSupport/Makefile src/Makefile tclsrc/Makefile tksrc/Makefile tktclsrc/Makefile tools/Makefile src/SYSLIBS tksrc/SYSLIBS"}
  2107. for file in .. ${CONFIG_FILES}; do if test "x$file" != x..; then
  2108.   srcdir=$top_srcdir
  2109.   # Remove last slash and all that follows it.  Not all systems have dirname.
  2110.   dir=`echo $file|sed 's%/[^/][^/]*$%%'`
  2111.   if test "$dir" != "$file"; then
  2112.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  2113.     test ! -d $dir && mkdir $dir
  2114.   fi
  2115.   echo creating $file
  2116.   rm -f $file
  2117.   echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
  2118.   sed -e "
  2119. $prsub
  2120. $extrasub
  2121. s%@TCL_ARCH@%$TCL_ARCH%g
  2122. s%@YACC@%$YACC%g
  2123. s%@RANLIB@%$RANLIB%g
  2124. s%@CC@%$CC%g
  2125. s%@MCS_CMD@%$MCS_CMD%g
  2126. s%@MAKEINCLUDE@%$MAKEINCLUDE%g
  2127. s%@MAKEQUOTE@%$MAKEQUOTE%g
  2128. s%@CPP@%$CPP%g
  2129. s%@LIBOBJS@%$LIBOBJS%g
  2130. s%@MAN_DIR_SEPARATOR@%$MAN_DIR_SEPARATOR%g
  2131. s%@srcbasedir@%$srcbasedir%g
  2132. s%@bldbasedir@%$bldbasedir%g
  2133. s%@tk_ok@%$tk_ok%g
  2134. s%@XINCLUDES@%$XINCLUDES%g
  2135. s%@XLIBSW@%$XLIBSW%g
  2136. s%@prefix@%$prefix%g
  2137. s%@execprefix@%$execprefix%g
  2138. s%@LIBS@%$LIBS%g
  2139. s%@srcdir@%$srcdir%g
  2140. s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file
  2141. fi; done
  2142.  
  2143. CONFIG_HEADERS=${CONFIG_HEADERS-"src/tclXconfig.h"}
  2144. for file in .. ${CONFIG_HEADERS}; do if test "x$file" != x..; then
  2145. echo creating $file
  2146.  
  2147. # These sed commands are put into SEDDEFS when defining a macro.
  2148. # They are broken into pieces to make the sed script easier to manage.
  2149. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME
  2150. # is the cpp macro being defined and VALUE is the value it is being given.
  2151. # Each defining turns into a single global substitution command.
  2152. #
  2153. # SEDd sets the value in "#define NAME VALUE" lines.
  2154. SEDdA='s@^\([     ]*\)#\([     ]*define[     ][     ]*\)'
  2155. SEDdB='\([     ][     ]*\)[^     ]*@\1#\2'
  2156. SEDdC='\3'
  2157. SEDdD='@g'
  2158. # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
  2159. SEDuA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2160. SEDuB='\([     ]\)@\1#\2define\3'
  2161. SEDuC=' '
  2162. SEDuD='\4@g'
  2163. # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
  2164. SEDeA='s@^\([     ]*\)#\([     ]*\)undef\([     ][     ]*\)'
  2165. SEDeB='$@\1#\2define\3'
  2166. SEDeC=' '
  2167. SEDeD='@g'
  2168. rm -f conftest.sed
  2169. EOF
  2170. # Turn off quoting long enough to insert the sed commands.
  2171. rm -f conftest.sh
  2172. cat > conftest.sh <<EOF
  2173. $SEDDEFS
  2174. EOF
  2175.  
  2176. # Break up $SEDDEFS (now in conftest.sh) because some shells have a limit
  2177. # on the size of here documents.
  2178.  
  2179. # Maximum number of lines to put in a single here document.
  2180. maxshlines=9
  2181.  
  2182. while :
  2183. do
  2184.   # wc gives bogus results for an empty file on some systems.
  2185.   lines=`grep -c . conftest.sh`
  2186.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2187.   rm -f conftest.s1 conftest.s2
  2188.   sed ${maxshlines}q conftest.sh > conftest.s1 # Like head -20.
  2189.   sed 1,${maxshlines}d conftest.sh > conftest.s2 # Like tail +21.
  2190.   # Write a limited-size here document to append to conftest.sed.
  2191.   echo 'cat >> conftest.sed <<CONFEOF' >> config.status
  2192.   cat conftest.s1 >> config.status
  2193.   echo 'CONFEOF' >> config.status
  2194.   rm -f conftest.s1 conftest.sh
  2195.   mv conftest.s2 conftest.sh
  2196. done
  2197. rm -f conftest.sh
  2198.  
  2199. # Now back to your regularly scheduled config.status.
  2200. cat >> config.status <<\EOF
  2201. # This sed command replaces #undef's with comments.  This is necessary, for
  2202. # example, in the case of _POSIX_SOURCE, which is predefined and required
  2203. # on some systems where configure will not decide to define it in
  2204. # src/tclXconfig.h.
  2205. cat >> conftest.sed <<\CONFEOF
  2206. s,^[     ]*#[     ]*undef[     ][     ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
  2207. CONFEOF
  2208. rm -f conftest.h
  2209. # Break up the sed commands because old seds have small limits.
  2210. maxsedlines=20
  2211. cp $top_srcdir/$file.in conftest.h1
  2212. while :
  2213. do
  2214.   lines=`grep -c . conftest.sed`
  2215.   if test -z "$lines" || test "$lines" -eq 0; then break; fi
  2216.   rm -f conftest.s1 conftest.s2 conftest.h2
  2217.   sed ${maxsedlines}q conftest.sed > conftest.s1 # Like head -20.
  2218.   sed 1,${maxsedlines}d conftest.sed > conftest.s2 # Like tail +21.
  2219.   sed -f conftest.s1 < conftest.h1 > conftest.h2
  2220.   rm -f conftest.s1 conftest.h1 conftest.sed
  2221.   mv conftest.h2 conftest.h1
  2222.   mv conftest.s2 conftest.sed
  2223. done
  2224. rm -f conftest.sed conftest.h
  2225. echo "/* $file.  Generated automatically by configure.  */" > conftest.h
  2226. cat conftest.h1 >> conftest.h
  2227. rm -f conftest.h1
  2228. if cmp -s $file conftest.h 2>/dev/null; then
  2229.   # The file exists and we would not be changing it.
  2230.   echo "$file is unchanged"
  2231.   rm -f conftest.h
  2232. else
  2233.   rm -f $file
  2234.   mv conftest.h $file
  2235. fi
  2236. fi; done
  2237.  
  2238.  
  2239.  
  2240. exit 0
  2241. EOF
  2242. chmod +x config.status
  2243. ${CONFIG_SHELL-/bin/sh} config.status
  2244.  
  2245.